<template>
    <div class="center">
    <table width="645" border="0" cellpadding="0" cellspacing="0" style="width:483.75pt;border-collapse:collapse;table-layout:fixed;">
   <colgroup><col width="88" style="mso-width-source:userset;mso-width-alt:2816;">
   <col width="72" span="2" style="width:54.00pt;">
   <col width="90" style="mso-width-source:userset;mso-width-alt:2880;">
   <col width="72" span="3" style="width:54.00pt;">
   <col width="107" style="mso-width-source:userset;mso-width-alt:3424;">
   </colgroup><tbody><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="38" width="645" colspan="8" rowspan="2" style="height:28.50pt;width:483.75pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;text-align:center" x:str="">电气倒闸操作危险点控制措施票</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="38" rowspan="2" style="height:28.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">操作任务</td>
    <td class="xl65" colspan="7" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.aa.workDetail}}</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="38" rowspan="2" style="height:28.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">操作票编号</td>
    <td class="xl65" colspan="7" rowspan="2" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;">{{this.aa.ticketId}}</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   </tr><tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">危险点</td>
    <td class="xl65" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">控制措施</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint1}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint1"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction1}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction1"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint2}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint2"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction2}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction2"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint3}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint3"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction3}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction3"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint4}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint4"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction4}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction4"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint5}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint5"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction5}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction5"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint6}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint6"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction6}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction6"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint7}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint7"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction7}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction7"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint8}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint8"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction8}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction8"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint9}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint9"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction9}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction9"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint10}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint10"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction10}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction10"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint11}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint11"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction11}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction11"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint12}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint12"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction12}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction12"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint13}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint13"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction13}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction13"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
   <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint14}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint14"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction14}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction14"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.dangerPoint15}}</td>
    <td class="xl66" height="19" colspan="4" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="dangerPoint15"></a-input>
    </td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.controlAction15}}</td>
    <td class="xl66" colspan="4" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="controlAction15"></a-input>
    </td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl65" height="19" colspan="8" style="height:14.25pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" x:str="">参加操作、监护人员声明：我已掌握上述危险点预控措施，在操作工程中，我将严格执行</td>
   </tr>
   <tr height="19" style="height:14.25pt;">
    <td class="xl69" height="19" style="height:14.25pt;" x:str="">操作人</td>
    <td class="xl66" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!draft">{{this.aa.doPerson}}</td>
    <td class="xl66" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="draft">
        <a-input v-model="doPerson"></a-input>
    </td>
    <td class="xl71" x:str="">监护人</td>
    <td class="xl66" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="!guar">{{this.aa.protectPerson}}</td>
    <td class="xl66" colspan="3" style="border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;" v-if="guar">
        <a-input v-model="protectPerson"></a-input>
    </td>
   </tr>
   
  </tbody></table>
    </div>
</template>
<script>
import JDate from '@/components/jeecg/JDate.vue'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import store from '@/store'
import{Time} from '@/utils/time'
import { httpAction, getAction,postAction,putAction } from '@/api/manage'
export default {
     components: {
      JDate,
      JDictSelectTag,
    },
    data(){
        return{
         aa:{},
         draft:false,
         dangerPoint1:'',
         dangerPoint2:'',
         dangerPoint3:'',
         dangerPoint4:'',
         dangerPoint5:'',
         dangerPoint6:'',
         dangerPoint7:'',
         dangerPoint8:'',
         dangerPoint9:'',
         dangerPoint10:'',
         dangerPoint11:'',
         dangerPoint12:'',
         dangerPoint13:'',
         dangerPoint14:'',
         dangerPoint15:'',
         controlAction1:'',
         controlAction2:'',
         controlAction3:'',
         controlAction4:'',
         controlAction5:'',
         controlAction6:'',
         controlAction7:'',
         controlAction8:'',
         controlAction9:'',
         controlAction10:'',
         controlAction11:'',
         controlAction12:'',
         controlAction13:'',
         controlAction14:'',
         controlAction15:'',
         doPerson:store.getters.userInfo.realname,
         guar:false,
         protectPerson:store.getters.userInfo.realname,



        }
    },
    props:['bb'], 
    methods:{
        refresh(){
            return this.aa.type
        },
        back(){
            var obj = {}
            if(this.draft == true){
                obj = {
                    id:this.aa.id,
                    ticketId:this.aa.ticketId,
                    dangerPoint1:this.dangerPoint1,
                    dangerPoint2:this.dangerPoint2,
                    dangerPoint3:this.dangerPoint3,
                    dangerPoint4:this.dangerPoint4,
                    dangerPoint5:this.dangerPoint5,
                    dangerPoint6:this.dangerPoint6,
                    dangerPoint7:this.dangerPoint7,
                    dangerPoint8:this.dangerPoint8,
                    dangerPoint8:this.dangerPoint8,
                    dangerPoint10:this.dangerPoint10,
                    dangerPoint11:this.dangerPoint11,
                    dangerPoint12:this.dangerPoint12,
                    dangerPoint13:this.dangerPoint13,
                    dangerPoint14:this.dangerPoint14,
                    dangerPoint15:this.dangerPoint15,
                    controlAction1:this.controlAction1,
                    controlAction2:this.controlAction2,
                    controlAction3:this.controlAction3,
                    controlAction4:this.controlAction4,
                    controlAction5:this.controlAction5,
                    controlAction6:this.controlAction6,
                    controlAction7:this.controlAction7,
                    controlAction8:this.controlAction8,
                    controlAction9:this.controlAction9,
                    controlAction10:this.controlAction10,
                    controlAction11:this.controlAction11,
                    controlAction12:this.controlAction12,
                    controlAction13:this.controlAction13,
                    controlAction14:this.controlAction14,
                    controlAction15:this.controlAction15,
                    doPerson:this.doPerson,
                }
            }else if(this.guar == true){
                obj = {
                    id:this.aa.id,
                    ticketId:this.aa.ticketId,
                    protectPerson:this.protectPerson,
                }
            }
            return obj
        },
    },
    mounted(){
        var param = {
            ticketId:this.bb.ticketId,
        }
        getAction('/eleswitchdanger/eleSwitchDanger/list',param).then(res=>{
            console.log('res',res)
            this.aa = res.result.records[0]
           console.log('aa',this.aa)

             var params={
                    userid:store.getters.userInfo.id
                }
             getAction('/sys/user/queryUserRole',params).then(res=>{
            console.log('dengji',res)
            if(res.result[0] == '1364736776864395266'){ //负责人
                    if(this.aa.doPerson == null){
                        this.draft = true
                    }
            }else if(res.result[0] == "1376346723403657218"){ //监护人
                 if(this.aa.doPerson != null && this.aa.protectPerson == null){
                        this.guar = true
                    }
            }
            })
        
            
           
            
        })
       
    }
}
</script>
<style scoped>
td{
    padding-top: 1px;
    padding-right: 1px;
    padding-left: 1px;
    vertical-align: middle;
    white-space: nowrap;
    color: windowtext;
    font-size: 12pt;
    font-weight: 400;
    font-style: normal;
    font-family: 宋体;
    text-decoration: none;
    border: 1px solid #000;
     }
.center{
    width:645px;
     background-color: #E5EDF0 !important;
     } 

</style>